package cn.tp.ksoft.civil_driver.bean;

import org.json.JSONObject;

import java.io.Serializable;
import java.util.Date;

import cn.tp.ksoft.library_civil.utils.StringUtils;


public class DriverDto implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * 主键
	 */
	private Long id;
	
	/**
	 * 供应商id
	 */
	private Long  providerId;
	
	/**
	 * 昵称
	 */
	private String nickname;
	
	/**
	 * 邮箱
	 */
	private String email;
	
	/**
	 * 电话
	 */
	private String telephone;
	
	/**
	 * 身份证
	 */
	private String idcard;
	
	/**
	 * 登录密码
	 */
	private String loginPwd;
	
	/**
	 * 登录时间
	 */
	private Date loginTime;

	/**
	 * 注册时间
	 */
	private Date regTime;
	
	/**
	 * 头像URL
	 */
	private String headImg;
	
	/**
	 *驾照 车辆行驶证Url 
	 */
	private String licenseImg;
	
	/**
	 * 出生日期
	 */
	private Date birthday;
	
	/**
	 * 是否冻结 1：冻结 0：否
	 */
	private boolean locked = false;
	
	/**
	 * 积分
	 */
	private Integer score;
	
	/**
	 * 手势密码
	 */
	private String gesturePwd;
	
	/**
	 * 1：内测 2：公测 3：正式
	 */
	private Integer type = 3;
	
	/**
	 * 姓名
	 */
	private String name;
	
	/**
	 * 性别
	 */
	private Integer sex;
	
	/**
	 *  1:待审核  2:通过  3:不通过
	 */
	private Integer auditStatus = 1;
	
	/**
	 * 是否信息完善 true:已完善 false ：未完善
	 */
	private boolean infoOvered = false;
	/**
	 * 不通过原因
	 */
	private String unPassReason ;
	/**
	 * 结算价格
	 */
	private Double price = 0d;
	/**
	 * 销售价格
	 */
	private Double salePrice = 0d;
	
	//----------车辆相关信息
	/**
	 * 车辆类型 1：轿车 2：商务车 :3：客车
	 */
	private Integer carType = 1;
	/*
	 * 颜色
	 */
	private String carColor = "";
	/**
	 * 座位数
	 */
	private Integer carSeat;
	/**
	 * 车牌号
	 */
	private String carNo;
	/**
	 * 驾驶证编号
	 */
	private String driveNo;
	
	/**
	 * 车辆品牌
	 */
	private String carBrand;
	/**
	 * 品牌型号
	 */
	private String carBrandType;
	
	/**
	 * 驾证获取时间
	 */
	private Date passportTime;
	
	/**
	 * 接单数(服务次数)
	 */
	private Integer orderCount = 0;
	
	
	public Integer getOrderCount() {
		return orderCount;
	}
	public void setOrderCount(Integer orderCount) {
		this.orderCount = orderCount;
	}
	public Integer getCarType() {
		return carType;
	}
	public void setCarType(Integer carType) {
		this.carType = carType;
	}
	public String getCarColor() {
		return carColor;
	}
	public void setCarColor(String carColor) {
		this.carColor = carColor;
	}
	public Integer getCarSeat() {
		return carSeat;
	}
	public void setCarSeat(Integer carSeat) {
		this.carSeat = carSeat;
	}
	public String getCarNo() {
		return carNo;
	}
	public void setCarNo(String carNo) {
		this.carNo = carNo;
	}
	public String getDriveNo() {
		return driveNo;
	}
	public void setDriveNo(String driveNo) {
		this.driveNo = driveNo;
	}
	public String getCarBrand() {
		return carBrand;
	}
	public void setCarBrand(String carBrand) {
		this.carBrand = carBrand;
	}
	public String getCarBrandType() {
		return carBrandType;
	}
	public void setCarBrandType(String carBrandType) {
		this.carBrandType = carBrandType;
	}
	public Date getPassportTime() {
		return passportTime;
	}
	public void setPassportTime(Date passportTime) {
		this.passportTime = passportTime;
	}
	public Long getProviderId() {
		return providerId;
	}
	public void setProviderId(Long providerId) {
		this.providerId = providerId;
	}
	public String getNickname() {
		return nickname;
	}
	public void setNickname(String nickname) {
		this.nickname = nickname;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getTelephone() {
		return telephone;
	}
	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}
	public String getIdcard() {
		return idcard;
	}
	public void setIdcard(String idcard) {
		this.idcard = idcard;
	}
	public String getLoginPwd() {
		return loginPwd;
	}
	public void setLoginPwd(String loginPwd) {
		this.loginPwd = loginPwd;
	}
	public Date getLoginTime() {
		return loginTime;
	}
	public void setLoginTime(Date loginTime) {
		this.loginTime = loginTime;
	}
	public Date getRegTime() {
		return regTime;
	}
	public void setRegTime(Date regTime) {
		this.regTime = regTime;
	}
	public String getHeadImg() {
		return headImg;
	}
	public void setHeadImg(String headImg) {
		this.headImg = headImg;
	}
	public Date getBirthday() {
		return birthday;
	}
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
	public boolean isLocked() {
		return locked;
	}
	public void setLocked(boolean locked) {
		this.locked = locked;
	}
	public Integer getScore() {
		return score;
	}
	public void setScore(Integer score) {
		this.score = score;
	}
	public String getGesturePwd() {
		return gesturePwd;
	}
	public void setGesturePwd(String gesturePwd) {
		this.gesturePwd = gesturePwd;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Integer getSex() {
		return sex;
	}
	public void setSex(Integer sex) {
		this.sex = sex;
	}

	public Integer getType() {
		return type;
	}
	public void setType(Integer type) {
		this.type = type;
	}
	public Integer getAuditStatus() {
		return auditStatus;
	}
	public void setAuditStatus(Integer auditStatus) {
		this.auditStatus = auditStatus;
	}
	public String getUnPassReason() {
		return unPassReason;
	}
	public void setUnPassReason(String unPassReason) {
		this.unPassReason = unPassReason;
	}
	public Double getPrice() {
		return price;
	}
	public void setPrice(Double price) {
		this.price = price;
	}
	public Double getSalePrice() {
		return salePrice;
	}
	public void setSalePrice(Double salePrice) {
		this.salePrice = salePrice;
	}
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getLicenseImg() {
		return licenseImg;
	}
	public void setLicenseImg(String licenseImg) {
		this.licenseImg = licenseImg;
	}
	public boolean getInfoOvered() {
		return infoOvered;
	}
	public void setInfoOvered(boolean infoOvered) {
		this.infoOvered = infoOvered;
	}
	
	
	public void parseJson(JSONObject json) {
		if (null == json) {
			return;
		}

		id = json.optLong("id");
		providerId = json.optLong("providerId");
		nickname = StringUtils.replaceNull(json.optString("nickname"));
		email = StringUtils.replaceNull(json.optString("email"));
		telephone = StringUtils.replaceNull(json.optString("telephone"));
		idcard = StringUtils.replaceNull(json.optString("idcard"));
		loginPwd = StringUtils.replaceNull(json.optString("loginPwd"));
		loginTime = new Date(json.optLong("loginTime"));
		regTime = new Date(json.optLong("regTime"));
		headImg = StringUtils.replaceNull(json.optString("headImg"));
		licenseImg = StringUtils.replaceNull(json.optString("licenseImg"));
		birthday = new Date(json.optLong("birthday"));
		locked = json.optBoolean("locked");
		score = json.optInt("score");
		gesturePwd = StringUtils.replaceNull(json.optString("gesturePwd"));
		type = json.optInt("type");
		name = StringUtils.replaceNull(json.optString("name"));
		sex = json.optInt("sex");
		auditStatus = json.optInt("auditStatus");
		infoOvered = json.optBoolean("infoOvered");
		unPassReason = StringUtils.replaceNull(json.optString("unPassReason"));
		price = json.optDouble("price");
		salePrice = json.optDouble("salePrice");
		carType = json.optInt("carType", 1);
		carColor = StringUtils.replaceNull(json.optString("carColor"));
		carSeat = json.optInt("carSeat");
		carNo = StringUtils.replaceNull(json.optString("carNo"));
		driveNo = StringUtils.replaceNull(json.optString("driveNo"));
		carBrand = StringUtils.replaceNull(json.optString("carBrand"));
		carBrandType = StringUtils.replaceNull(json.optString("carBrandType"));
		passportTime = new Date(json.optLong("passportTime"));
		orderCount = json.optInt("orderCount");
	}
}
